<?php
namespace Store\Controller;
use Think\Controller;
class JoininController extends Controller
{

    public function  _initialize(){
        layout(false);
    }

    //入住须知
    public function index()
    {
        $this->display();

    }

    //个人或公司信息认证
    public function company()
    {
        $store_joinin                           = M('store_joinin');
        $re = $store_joinin->where(array('user_id'=>session('user_id')))->find();
        if(!$re && IS_POST)
        {
            $data['company_name']                   = I('company_name');
            $data['company_phone']                  = I('company_phone');
            $data['company_province_id']            = I('province_id');
            $data['company_address']                = getCityName(I('province_id'),I('city_id'),I('area_id'));;
            $data['company_address_detail']         = I('company_address_detail');
            $data['company_employee_count']         = I('company_employee_count');
            $data['company_registered_capital']     = I('company_registered_capital');
            $data['contacts_name']                  = I('contacts_name');
            $data['contacts_phone']                 = I('contacts_phone');
            $data['contacts_email']                 = I('contacts_email');
            $data['bank_account_name']              = I('bank_account_name');
            $data['bank_account_number']            = I('bank_account_number');
            $data['bank_name']                      = I('bank_name');
            $data['bank_code']                      = I('bank_code');
            $data['image']                          = I('image');
            $data['settlement_bank_account_name']   = I('settlement_bank_account_name');
            $data['settlement_bank_account_number'] = I('settlement_bank_account_number');
            $data['settlement_bank_name']           = I('settlement_bank_name');
            $data['settlement_bank_code']           = I('settlement_bank_code');
            $data['user_id']                        = 123;
            $data['user_name']                      = 123;

            $re = $store_joinin->add($data);

            if($re){
                echo 111;die;
            }else{
                echo 222;die;
            }

        }else{
            $this->assign('company',$re);
            $this->display();
        }
    }

    //店铺信息认证
    public function shop()
    {
        $this->display();
    }

    //等待审核
    public function audit()
    {
        $this->display();
    }




}